﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Pages/Site1.Master" AutoEventWireup="true" CodeBehind="Teacher_Search.aspx.cs" Inherits="ES_Project.Pages.WebForm33" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        table{font-size:small;
margin-top: 0px;
    color: #000000;
}
TABLE {
	MARGIN-BOTTOM: 0px
}
        .style4
        {
            width: 1167px;
        }
    .DNNAlignright {
	TEXT-ALIGN: right
}
select,input,button,textarea,button{font:99% arial,helvetica,clean,sans-serif;}
INPUT {
	FONT: 700 small normal normal arial, helvetica, clean, sans-serif; COLOR: #057cc4; MARGIN-LEFT: 0px; MARGIN-RIGHT: 0px;
    text-align: left;
}
SELECT {
	FONT: 700 small normal normal arial, helvetica, clean, sans-serif; COLOR: #057cc4; MARGIN-LEFT: 0px; MARGIN-RIGHT: 0px
}
TEXTAREA {
	FONT: 700 small normal normal arial, helvetica, clean, sans-serif; COLOR: #057cc4; MARGIN-LEFT: 0px; MARGIN-RIGHT: 0px
}
TH {
	FONT-FAMILY: Tahoma, Arial, Helvetica; COLOR: #003366; FONT-SIZE: 12px; VERTICAL-ALIGN: baseline; FONT-WEIGHT: bold
}
        .style15
        {
            width: 100%;
        }
        .style19
        {
            width: 47px;
        }
        .style20
        {
            width: 1167px;
            font-size: small;
        }
        </style>
  
  <link type="text/css" href="js/js/css/ui-lightness/jquery-ui-1.8.10.custom.css" rel="stylesheet" />	
  <script type="text/javascript" src="js/js/jquery-1.4.4.min.js"></script>
  <script type="text/javascript" src="js/js/jquery-ui-1.8.10.offset.datepicker.min.js"></script>
  <script type="text/javascript" src="js/js/jquery.datepick-th.js"></script>

  <link rel="stylesheet" type="text/css" href="style/dhtmlwindow.css"/>
  <link rel="stylesheet" type="text/css" href="style/modal.css"/>
  <script type="text/javascript" src="script/dhtmlwindow.js"></script>

  <script type="text/javascript" src="script/modal.js"></script>

  <script type="text/javascript" src="script/yahoo-dom-event.js"></script>

  <script type="text/javascript" src="script/container_core-min.js"></script>
    <style type="text/css">

/* Overide css code กำหนดความกว้างของปฏิทินและอื่นๆ */ 
.ui-datepicker{

	width:170px;

	font-family:tahoma;

	font-size:11px;

	text-align:center;

}
        .style30
        {
            font-size: small;
            text-align: right;
            width: 183px;
            height: 22px;
        }
        .style31
        {
            width: 243px;
            height: 22px;
        }
        .style18
        {
            font-size: small;
        }
        .style37
        {
            width: 105px;
        }
        .style40
        {
            width: 204px;
            height: 22px;
        }
        .style42
        {
            font-size: small;
            text-align: right;
            width: 287px;
            height: 22px;
        }
        .style44
        {
            width: 79px;
            height: 22px;
        }
        .style46
        {
            width: 308px;
            height: 22px;
        }
        .style48
        {
            font-size: small;
            text-align: right;
            width: 183px;
        }
        .style49
        {
            width: 147px;
        }
        .style50
        {
            width: 204px;
        }
        .style51
        {
            width: 243px;
        }
        .style52
        {
            width: 308px;
        }
        .style53
        {
            font-size: small;
            text-align: right;
            width: 287px;
        }
        .style54
        {
            width: 79px;
        }
        </style>
  <script type="text/javascript">
      function getDate(elem) {
          var elemVal = elem.value;
          var elemId = elem.id;
          switch (elemVal.length) {
              case 2:
                  var ielemVal = elemVal * 1;
                  if (ielemVal < 32) {
                      elemVal = elemVal + "/";
                  } else {
                      elemVal = elemVal.replace(elemVal, "");
                      window.event.returnValue = false;
                  }
                  break;
              case 5:
                  var i2 = elemVal.substring(3, 7);
                  i2 = i2 * 1; if (i2 < 13) {
                      elemVal = elemVal + "/";
                  } else {
                      elemVal = elemVal.substring(0, 3);
                      window.event.returnValue = false;
                  }
                  break;
              case 9:
                  var i3 = elemVal.substring(6, 9); i3 = i3 * 1;
                  if (200 < i3 && i3 < 2600) {
                  } else {
                      elemVal = elemVal.substring(0, 5);
                      window.event.returnValue = false;
                  }
                  break;
          }
          document.getElementById(elemId).value = elemVal;
      }

      

      
</script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
  
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <script type="text/javascript">

            function opennewsletter(a) {

            var value1 = a
            emailwindow = dhtmlmodal.open('EmailBox', 'iframe', value1, 'บันทึกการชำระเงิน', 'width=700px,height=440px,center=1,resize=0,scrolling=1')

                emailwindow.onclose = function () { //Define custom code to run when window is closed
                    var theform = this.contentDoc.forms[1] //Access first form inside iframe just for your reference
                    var theemail = this.contentDoc.getElementById("emailfield") //Access form field with id="emailfield" inside iframe
                    if (theemail.value.indexOf("@") == -1) { //crude check for invalid email
                        alert("Please enter a valid email address")
                        return false //cancel closing of modal window
                    }
                    else { //else if this is a valid email
                        document.getElementById("youremail").innerHTML = theemail.value //Assign the email to a span on the page
                        return true //allow closing of window
                    }
                }
            } //End "opennewsletter" function
            function validate() {
                //alert(document.getElementById("ContentPlaceHolder1_empCode").value);
                if (document.getElementById("ContentPlaceHolder1_empCode").value == "") {
                    alert('กรุณากรอกรหัสครู');
                    return false;
                }
                if (document.getElementById("ContentPlaceHolder1_empName").value == "") {
                    alert('กรุณากรอกชื่อ-นามสกุลครู');
                    return false;
                } 
                if (document.getElementById("ContentPlaceHolder1_empIdCard").value == "") {
                    alert('กรุณากรอกรหัสบัตรประชาชนครู');
                    return false;
                } 
                return true;

            }
 
</script>

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <table cellpadding="0" cellspacing="0" class="style2">
            <%--<a href="#" onClick="opennewsletter(); return false">Signup for our newletter</a> <span id="youremail" style="color: red"></span>
 --%>

                <tr>
                    <td class="style37">
                        &nbsp;</td>
                    <td class="style4">
                        <strong>ค้นหาข้อมูลครู/พนักงาน</strong></td>
                    <td class="style19">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style37">
                        &nbsp;</td>
                    <td class="style4">
                        &nbsp;</td>
                    <td class="style19">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style37">
                        &nbsp;</td>
                    <td class="style4">
                        <table cellpadding="0" cellspacing="0" class="style15">
                            <tr>
                                <td class="style53">
                                    <b>รหัส :</b></td>
                                <td class="style50">
                                <asp:TextBox ID="emp_id" runat="server" style="display:none"></asp:TextBox>
                                    <asp:TextBox ID="empCode" runat="server" Width="120px"></asp:TextBox>
                                    <asp:TextBox ID="TextBox1" runat="server" Width="120px" style="display:none"></asp:TextBox>
                                    <asp:TextBox ID="TextBox2" runat="server" Width="120px" style="display:none"></asp:TextBox>
                                </td>
                                <td class="style54">
                                    &nbsp;</td>
                                <td class="style48">
                                    <b>ชื่อ-นามสกุล ครู :</b></td>
                                <td class="style52">
                                    <asp:TextBox ID="empName" runat="server" Width="120px"></asp:TextBox>
                                </td>
                                <td class="style51">
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td class="style53">
                                    &nbsp;</td>
                                <td class="style50">
                                    &nbsp;</td>
                                <td class="style54">
                                    &nbsp;</td>
                                <td class="style48">
                                    &nbsp;</td>
                                <td class="style52">
                                    &nbsp;</td>
                                <td class="style51">
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td class="style42">
                                    <strong>บัตรประชาชน :</strong></td>
                                <td class="style40">
                                    <asp:TextBox ID="empIdCard" runat="server" Width="120px"></asp:TextBox>
                                </td>
                                <td class="style44">
                                    &nbsp;</td>
                                <td class="style30">
                                    <strong>อายุ : </strong></td>
                                <td class="style46">
                                    <asp:TextBox ID="empAge" runat="server" Width="101px"></asp:TextBox>
                                    &nbsp;<span class="style18"><strong>ปี</strong></span></td>
                                <td class="style31">
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td class="style53">
                                    &nbsp;</td>
                                <td class="style50">
                                    &nbsp;</td>
                                <td class="style54">
                                    &nbsp;</td>
                                <td class="style48">
                                    &nbsp;</td>
                                <td class="style52">
                                    &nbsp;</td>
                                <td class="style51">
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td class="style53">
                                    <strong>เริ่มสอนเมื่อ :</strong></td>
                                <td class="style50">
                                
                                    
                                    <asp:TextBox ID="empBegin" runat="server" Width="120px"></asp:TextBox>
                                    <script type="text/javascript">
                                        $(Sys.Application.add_load(function () {
                                            var dateBefore = null;

                                            $("#ContentPlaceHolder1_empBegin").datepicker({

                                                changeMonth: true,
                                                changeYear: true,
                                                showOn: 'button',
                                                isBuddhist: true,
                                                buttonImage: 'images/formcal.gif',
                                                buttonImageOnly: true

                                            });

                                        }));
                                    </script>
                                </td>

                                <td class="style54">
                                    &nbsp;</td>

                                <td class="style48">
                                    <strong>ลาออกเมื่อ:</strong></td>
                                <td class="style52">
                                    <asp:TextBox ID="empEnd" runat="server" Width="120px"></asp:TextBox>
                                    <script type="text/javascript">
                                        $(Sys.Application.add_load(function () {
                                            var dateBefore = null;

                                            $("#ContentPlaceHolder1_empEnd").datepicker({

                                                changeMonth: true,
                                                changeYear: true,
                                                showOn: 'button',
                                                isBuddhist: true,
                                                buttonImage: 'images/formcal.gif',
                                                buttonImageOnly: true

                                            });

                                        }));
                                    </script>
                                </td>
                                <td class="style51">
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td class="style53">
                                    &nbsp;</td>
                                <td class="style50">
                                    &nbsp;</td>
                                <td class="style54">
                                    &nbsp;</td>
                                <td class="style48">
                                    &nbsp;</td>
                                <td class="style52">
                                    &nbsp;</td>
                                <td class="style51">
                                    &nbsp;</td>
                            </tr>
                            <%--<tr>
                                <td class="style16">
                                    <strong>รหัสการรับเงิน :</strong></td>
                                <td colspan="5">
                                    <asp:TextBox ID="TextBox22" runat="server" Width="98px"></asp:TextBox>
                                    &nbsp;&nbsp;
                                    <asp:TextBox ID="TextBox23" runat="server" Width="249px"></asp:TextBox>
                                </td>
                            </tr>--%>
                            <tr>
                                <td class="style53">
                                    &nbsp;</td>
                                <td class="style50">
                                    &nbsp;</td>
                                <td class="style54">
                                    &nbsp;</td>
                                <td class="style48">
                                    &nbsp;</td>
                                <td class="style52">
                                    &nbsp;</td>
                                <td class="style51">
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td class="style53">
                                    &nbsp;</td>
                                <td class="style50">
                                    <asp:Button ID="CMD_SEARCH" runat="server" Text="  ค้นหา  " Width="60px" 
                                        onclick="CMD_SEARCH_Click"  />
                                        <%--<asp:Button ID="CMD_EDIT" runat="server" Text="  แก้ไข  " Width="60px" 
                                        onclick="CMD_INSERT_Click" OnClientClick ="return validate()"/>--%>
                                    &nbsp;<asp:Button ID="CMD_CLEAR" runat="server" Text="  เคลียร์  " Width="60px" 
                                        onclick="CMD_CLEAR_Click" />
                                        
                                </td>
                                <td class="style54">
                                    &nbsp;</td>
                                <td class="style48">
                                    &nbsp;</td>
                                <td class="style52">
                                    &nbsp;</td>
                                <td class="style51">
                                    &nbsp;</td>
                            </tr>
                        </table>
                    </td>
                    <td class="style19">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style37">
                        &nbsp;</td>
                    <td class="style20">
                        <strong>แสดงข้อมูลครู</strong></td>
                    <td class="style19">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style37">
                        &nbsp;</td>
                    <td class="style4">
                        <asp:GridView ID="GridView4" runat="server" 
                         AutoGenerateColumns="False" DataKeyNames="emp_id" onrowdatabound="GridView4_RowDataBound" Width="100%" 
                         onselectedindexchanged="GridView4_SelectedIndexChanged" >
                        <AlternatingRowStyle BackColor="PaleGoldenrod"  />
                                      <Columns>
                                          <asp:TemplateField ItemStyle-HorizontalAlign="Center">
                                              <HeaderTemplate>
                                                  ลำดับ
                                              </HeaderTemplate>
                                              <ItemTemplate>
                                                  <%#Container.DataItemIndex+1 %>
                                              </ItemTemplate>
                                              <ItemStyle HorizontalAlign="Center" />
                                          </asp:TemplateField>
                                          <asp:TemplateField Visible="false">
                                              <ItemTemplate>
                                                  <asp:HiddenField ID="HiddenField3" runat="server" Visible="false"
                                                      Value='<%# Eval("emp_id") %>' />
                                              </ItemTemplate>
                                          </asp:TemplateField>
                                           <asp:BoundField DataField="emp_code" HeaderText="รหัสครู/พนักงาน" 
                                              ItemStyle-HorizontalAlign="left"  >
                                              <ItemStyle HorizontalAlign="Left" />
                                          </asp:BoundField>
                                           <asp:BoundField DataField="emp_name" HeaderText="ชื่อครู/พนักงาน" 
                                              ItemStyle-HorizontalAlign="left"  >
                                              <ItemStyle HorizontalAlign="Left" />
                                          </asp:BoundField>
                                          <asp:TemplateField HeaderText="รหัสชำระเงิน" ItemStyle-HorizontalAlign="left">
                                            <ItemStyle HorizontalAlign="Left" />  
                                               <ItemTemplate>
                                                    <asp:HyperLink  ID="HyFO4" runat="server"  ImageUrl="~/Pages/images/search.png"  Text ='<%# Eval("emp_id") %>' ></asp:HyperLink>
                                               </ItemTemplate>
                                               
                                               <ItemStyle HorizontalAlign="Center" />
                                           </asp:TemplateField>
                                           <asp:TemplateField HeaderText="แก้ไข" ItemStyle-HorizontalAlign="left">
                                            <ItemStyle HorizontalAlign="Left" />  
                                               <ItemTemplate>
                                                    <asp:HyperLink  ID="edit" runat="server"  ImageUrl="~/Pages/images/icon_15.gif"  Text ='<%# Eval("emp_id") %>' ></asp:HyperLink>
                                               </ItemTemplate>
                                               
                                               <ItemStyle HorizontalAlign="Center" />
                                           </asp:TemplateField>
                                          

                                           <%--<asp:CommandField ButtonType="Image" HeaderText="แก้ไข" 
                                              ItemStyle-HorizontalAlign="Center" 
                                              SelectImageUrl="~/Pages/images/icon_15.gif" ShowSelectButton="True" >
                                              <ItemStyle HorizontalAlign="Center" />
                                          </asp:CommandField>--%>
                                          <asp:TemplateField HeaderText="ลบ" ItemStyle-HorizontalAlign="Center" 
                                              ShowHeader="False">
                                              <ItemTemplate>
                                                  <asp:ImageButton ID="ImageButton1" runat="server" CausesValidation="False" 
                                                      CommandName="Delete" ImageUrl="~/Pages/images/icon_del.gif" 
                                                      Text="Delete" />
                                              </ItemTemplate>
                                              <ItemStyle HorizontalAlign="Center" />
                                          </asp:TemplateField>
                                         </Columns>  
                                         <EditRowStyle BackColor="#2461BF" />
                            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                            <RowStyle BackColor="#EFF3FB" />
                            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                            <SortedAscendingCellStyle BackColor="#F5F7FB" />
                            <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                            <SortedDescendingCellStyle BackColor="#E9EBEF" />
                            <SortedDescendingHeaderStyle BackColor="#4870BE" />
                        </asp:GridView>
                          <%--<asp:EntityDataSource ID="EntityDataSource1" runat="server" 
                        ConnectionString="name=essystemEntities"   
                        DefaultContainerName="essystemEntities" EnableDelete="True" 
                       AutoGenerateWhereClause="true" EnableInsert="True" EnableUpdate="True"   
                         EntitySetName="emp_mast"    > 
                    </asp:EntityDataSource>--%>
                        
                    </td>
                    <td class="style19">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style37">
                        &nbsp;</td>
                    <td class="style4">
                        &nbsp;</td>
                    <td class="style19">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style37">
                        &nbsp;</td>
                    <td class="style4">
                        
                    </td>
                    <td class="style19">
                        &nbsp;</td>
                </tr>
                
            </table>
        </ContentTemplate>
    </asp:UpdatePanel>
     <br />
   
</asp:Content>
